from django.contrib import admin
from .models import PointTransaction, BusinessDictionary


@admin.register(PointTransaction)
class PointTransactionAdmin(admin.ModelAdmin):
    """积分流水管理"""
    list_display = ['transaction_id', 'user', 'points', 'action_type', 'related_id', 'created_at']
    list_filter = ['action_type', 'created_at']
    search_fields = ['user__username', 'action_type']
    ordering = ['-created_at']


@admin.register(BusinessDictionary)
class BusinessDictionaryAdmin(admin.ModelAdmin):
    """业务字典管理"""
    list_display = ['business_id', 'business_type', 'description', 'created_at']
    search_fields = ['business_type', 'description']
